#ifndef __MCS__ELEMENT__HPP
#define __MCS__ELEMENT__HPP

#include "Object.hpp"
#include "SourceLocation.hpp"

class Block;

class Element : public Object
{
public:
	Element(SourceLocation const & location)
		: Object()
		, parentBlock_()
		, location_(location)
	{}

	SourceLocation const & location() const { return location_; }

	Block * parentBlock() const { return parentBlock_; }
	virtual void init(Block * parentBlock) { parentBlock_ = parentBlock; }

	virtual void execute() const = 0;

	 //implemented in Block.cpp
	virtual ptr<Element> concat(ptr<Element> other);
private:
	Block * parentBlock_;
	SourceLocation location_;
};


#endif //__MCS__ELEMENT__HPP
